<template>
  <view>
    <view class="ge2"></view>

    <view class="ding">
      <view class="kk_ding">
        <view class="kk_ding_nei">
          <view class="tx">
            <image style="width: 100%;height: 100%" :src="detail.snapshoot.store_info.logo"></image>
          </view>
          <view class="name">{{ detail.snapshoot.store_info.name }}</view>
          <view></view>
        </view>

        <view class="qx">已取消</view>
      </view>

      <view class="kk_zhong">
        <view class="zhong_tx">
          <image style="width: 100%;height: 100%" :src="detail.snapshoot.cover"></image>
        </view>
        <view>
          <view class="zhong_h1">{{detail.snapshoot.name}}</view>

          <view class="zhong_nk">
            <view>下单时间：</view>
            <view>{{detail.create_time}}</view>
          </view>

          <view class="zhong_nk">
            <view>消费时段：</view>
            <view>{{detail.start_time}} 至 {{detail.end_time}}</view>
          </view>

          <view class="zhong_nk">
            <view>预定时段：</view>
            <view>{{detail.start_time}} 至 {{detail.end_time}}</view>
          </view>

          <view class="zhong_h1">总计 ￥{{detail.price}}</view>
        </view>
      </view>
    </view>

    <view class="zhong">
      <view class="zhong_text">
        <view>订单总金额</view>
        <view>{{detail.pay_price}}</view>
      </view>

      <view class="zhong_text">
        <view>会员优惠</view>
        <view>0</view>
      </view>

      <view class="zhong_text">
        <view>在线支付</view>
        <view>{{detail.pay_price}}</view>
      </view>

      <view class="zhong_text2">
        <view>实付款</view>
        <view>￥{{detail.pay_price}}</view>
      </view>
    </view>

    <view class="ge2"></view>

    <view class="zhong">
      <view class="zhong_text2">订单信息</view>
      <view class="zhong_text3">
        <view>订单编号</view>
        <view class="bh">{{detail.order_no}}</view>
        <view class="fz" @tap="copyone(detail.order_no)">复制</view>
      </view>

      <view class="zhong_text3">
        <view>创建时间</view>
        <view class="bh">{{detail.create_time}}</view>
      </view>
    </view>

    <view class="ge2"></view>

    <view class="kk_di">
      <view class="di_qx" @tap="delone">
        <view>删除订单</view>
      </view>
    </view>
  </view>
</template>

<script>
// pages/dingdanxiangqing/yiwancheng.js
import {houseorderdetails} from "@/common/api";

export default {
  data() {
    return {
      detail:{}
    };
  }
  /**
   * 生命周期函数--监听页面加载
   */,
  onLoad(options) {
    this.getorderdetails(options.id)
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  },
  methods: {
    // 获取详情
    getorderdetails(id) {
      houseorderdetails({
        order_id:id
      },res=>{
        this.detail=res.data.data
        console.log('order_id',res)
      })
    },
    // 复制
    copyone: function (copydata) {
      uni.setClipboardData({
        data: copydata, // e是你要保存的内容
        success: function () {
          uni.showToast({
            title:'复制成功',
            duration: 2000,
            mask: true // 设置为true，使背景半透明
          })
        }
      })
    },

    delone: function () {
      uni.showModal({
        title: '确认删除',
        content: '确认要删除此单吗',
        success: function (res) {
          if (res.confirm) {
            console.log('确定');
          } else if (res.cancel) {
            console.log('取消');
          }
        }
      });
    }
  }
};
</script>
<style>
.ding {
  border-bottom: 1rpx solid rgba(129, 129, 129, 0.363);
}

.kk_ding {
  display: flex;
  align-items: center;
  padding: 20rpx;
  font-size: 32rpx;
  margin-left: 20rpx;
}

.kk_ding_nei {
  display: flex;
  margin-right: 300rpx;
  align-items: center;
  font-weight: bold;
}

.tx {
  width: 50rpx;
  height: 50rpx;
  background-color: white;
  border-radius: 50%;
  margin-right: 10rpx;
}

.qx {
  color: rgb(143, 143, 143);
}

.kk_zhong {
  display: flex;
  margin: 20rpx 0rpx 20rpx 0rpx;
  padding: 0 0 0 40rpx;
}

.zhong_tx {
  width: 130rpx;
  height: 130rpx;
  background-color: blue;
  margin-right: 10rpx;
  border-radius: 5px; /* 圆角设置为20px */
}

.zhong_nk {
  display: flex;
  color: rgb(129, 129, 129);
  font-size: 27rpx;
  line-height: 2;
}

.zhong_h1 {
  font-weight: bold;
  font-size: 31rpx;
  margin-bottom: 10rpx;
}

.zhong {
  padding: 40rpx;
  color: rgb(104, 104, 104);
}

.zhong_text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40rpx;
}

.zhong_text2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #000;
  font-weight: bold;
}

.zhong_text3 {
  display: flex;
  margin-bottom: 40rpx;
  margin-top: 50rpx;
  font-size: 28rpx;
}

.bh {
  margin-left: 40rpx;
  margin-right: 10rpx;
}

.fz {
  background-color: rgba(224, 224, 224, 0.377);
  font-size: 25rpx;
  padding: 3rpx 7rpx 3rpx 7rpx;
  border-radius: 4px; /* 圆角设置为20px */
}

.kk_di {
  display: flex;
  justify-content: flex-end;
  font-size: 30rpx;
  margin: 40rpx 20rpx 30rpx 0;
}

.di_qx {
  border: 1px solid rgb(175, 175, 175);
  border-radius: 4px; /* 圆角设置为20px */
  padding: 10rpx 20rpx 10rpx 20rpx;
  margin-right: 30rpx;
}

.di_jx {
  background-color: rgb(126, 212, 155);
  border-radius: 4px; /* 圆角设置为20px */
  padding: 10rpx 20rpx 10rpx 20rpx;
  margin-right: 20rpx;
  color: rgb(255, 255, 255);
}
</style>
